package com.app.bo.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.app.entity.User;
import com.app.jpa.security.SecurityDataService;
import com.app.to.Usuario;

@Component("securityBO")
public class SecurityBO {

	@Autowired
	private SecurityDataService securityService;

	public Usuario validateLoginAccess(Usuario user) {
		User entity = securityService.validateLoginAccess(user);
		System.out.println("" +entity);
		if(entity == null)
			return null;
		user.setNivelAcceso(entity.getEstado());
		return user;
	}

}
